@ECHO OFF

SET OUTPUT_DIR=build\windows32-release
SET CMAKE_DIR=C:\Program Files\CMake 2.8\bin\
SET VISUAL_STUDIO_DIR=C:\Program Files\Microsoft Visual Studio 10.0

IF NOT EXIST "%OUTPUT_DIR%" (
  MKDIR %OUTPUT_DIR%

  IF %errorlevel% NEQ 0 (
    ECHO Doslo k chybe - nepodarilo se vytvorit slozku "%OUTPUT_DIR%".
    pause
    exit
  )
)

CD %OUTPUT_DIR%

IF %errorlevel% NEQ 0 (
  ECHO Doslo k chybe - nepodarilo se prepnout do slozky "%OUTPUT_DIR%".
  pause
  exit
)

"%CMAKE_DIR%cmake" -DBUILD_X64:BOOL="0" -DCMAKE_BUILD_TYPE="release" -G"Visual Studio 10" ../../src

IF %errorlevel% NEQ 0 (
  ECHO Doslo k chybe - cmake selhal.
  pause
  exit
)

"%VISUAL_STUDIO_DIR%\Common7\IDE\devenv.com" /build Release fit-mi-run.sln

IF %errorlevel% NEQ 0 (
  ECHO Doslo k chybe - nepodarilo se spustit kompilaci.
  pause
  exit
)

ECHO Hotovo.
pause
